Repository navigation
crypto: RFC 9001 Appendix A.1 to A.4 (QUIC packet protection) as tests on every AES-GCM backend - #24
Merged
Merged
Conversation
…ion, as tests on OpenSSL, on BearSSL with ctaes for the block and on the defaults, with no QUIC API; the capability table names them
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RFC 9001 (QUIC-TLS) Appendix A as interop tests: proof, with the RFC's published vectors, that webcpp::crypto (with webcpp::hash's HKDF) does QUIC version 1's packet protection byte for byte. This is the owner's 2026-12-01 decision: the roadmap item "crypto aes128-gcm" shrank to these tests, since
ciphers::aes128_gcmalready exists. It adds tests only. There is no QUIC API and no new public function. Design: webcpporg/proposals,libraries/crypto/openspec/changes/rfc9001-tests(rulings R1 to R9).test/support/quic_rfc9001_vectors.hpp: RFC 9001 section 5.2's initial salt, section 5.8's Retry key and nonce, and Appendix A.1 to A.4, copied from the RFC Editor's text. Each value names its section, and a script confirmed that every hex string occurs in the RFC.test/support/quic_rfc9001.hpp: the checks, as templates over the AEAD (gcm<aes128<B>>) and the header protection's block cipher (aes128<B>):hash::hkdf_expandover pieces{length, label length, "tls13 ", label, 0}.iv XOR packet number, then mask withAES-ECB(hp, sample)through the publicaes128<B>::encrypton one block. Unprotecting gives back the RFC's header and payload; the packet number length is read from the unmasked first byte.authentication_failed, and the payload is zeroed._no_exceptions:quic_rfc9001_openssl: OpenSSL for both the AEAD and the block; native, wasip2, wasip3.quic_rfc9001_bearssl: BearSSL for GCM and ctaes for the block, since BearSSL has none; every target, Emscripten included.quic_rfc9001_default:aes128_gcmandaes128<>; every target.doc/tables/crypto.jsonnames the new tests as evidence forgcm(OpenSSL, BearSSL) andaes_block(OpenSSL, ctaes).generate.pyregenerated the pages.What is not covered: A.5 (ChaCha20-Poly1305 short header). crypto exposes the AEAD but not raw ChaCha20, which A.5's header protection needs. A.5 joins with the planned
ciphers::chacha20of the changeprimitives.Verified locally:
generate.py --check,generate_test.pyandtools/test/crypto_jamfiles_test.py: ok.🤖 Generated with Claude Code